﻿
@{
    ViewBag.Title = "Tickets - List by creators";
    Layout = "~/Views/Shared/_ContentSideBar.cshtml";
}
<div id="content">

@{var ticketCreators = new BetterTaskList.Models.Tickets.TicketRepository().GetTicketCreators(); }

 @if(ticketCreators.Count() > 0)
    {   
    
     foreach(var creator in ticketCreators){

       <div style=" margin-bottom:10px;">
            <div id="actionAvatar" style="float: left; padding-right: 4px;">
                <a href="@Url.Action("Profile", "Home", new { area = "", id = creator })" >
                <img src="@Url.Content(BetterTaskList.Helpers.UserHelpers.GetUserAvatarUrl(creator, "128x128"))" height="64px" width="64px" alt="action avatar" />
                </a>
            </div>
            
            <div style="float: left; font-size: 12px;">
                 <h3>@Html.ActionLink(BetterTaskList.Helpers.UserHelpers.GetUserFullName(creator), "Profile", "Home", new { area = "", id = creator }, new { @Style = "text-decoration: none;" })</h3>
             </div>
    
            <div style="float:left; border-bottom: 1px solid #CCC; padding-top: 8px; padding-bottom: 22px; width: 88%;">

            @foreach(var ticket in new BetterTaskList.Models.Tickets.TicketRepository().GetNewTickets(creator)) 
            {
                <div style="float: left; padding-left: 14px; padding-top: 6px;">
                  #@ticket.TicketId: @Html.ActionLink(@ticket.TicketSubject, "Details", "Ticket", new {id = ticket.TicketId}, null)
                </div>
            }
              </div>
              <div class="clear"></div>
         </div>
     }
     
    }else { <text>No tickets exist at the moment...</text> @Html.ActionLink("Click to create a new one", "Create", "Tickets", null )}

</div>



<div id="sidebar" class="sidebar widget-area">
    <div style="width:269px;">@Html.Partial("_DraftTickets")</div>
</div>

